import request from '@/utils/request';

export default {

  // 添加课程信息
  addCourseInfo(courseInfo) {
    return  request({
      url: "/eduService/course/addCourseInfo",
      method: "post",
      data: courseInfo
    })
  },

  // 根据id查询课程信息
  getCourseInfoId(id) {
    return  request({
      url: `/eduService/course/getCourseInfo/${id}`,
      method: "get"
    })
  },
  // 修改课程信息
  updateCourseInfo(courseInfo) {
    return  request({
      url: "/eduService/course/updateCourseInfo",
      method: "put",
      data: courseInfo
    })
  },
  // 课程确认显示
  getPublishInfo(courseId) {
    return  request({
      url: "/eduService/course/getPublishCourseInfo/" + courseId,
      method: "get"
    })
  },
  // 课程的最终发布, 修改课程状态
  publishCourse(courseId) {
    return  request({
      url: "/eduService/course/publishCourse/" + courseId,
      method: "post"
    })
  },
  // 查询所有课程
  getListCourses() {
    return  request({
      url: "/eduService/course",
      method: "get"
    })
  },
  // 分页条件查询
  pageCourse(current, limit, courseQuery){
    return  request({
      url: "eduService/course/pageCourse/"+current + "/"+ limit,
      method: "post",
      data: courseQuery
    })

  },
  // 通过Id删除课程
  removeCourseById(courseId) {
    return  request({
      url: "/eduService/course/" + courseId,
      method: "delete"
    })
  }
}
